<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>TODO supply a title</title>
    </h:head>
    <h:body>
        <h:form id="emp">
            <rich:panel header="明细表" styleClass="content-hight">
                <rich:tabPanel  >
                    <rich:tab  header="查询条件" style="text-align:left;">
                        <h:outputText value="单据日期："/>
                        <h:panelGroup>
                            <rich:calendar value="#{stit.qlb.numDateStart}"
                                           locale="zh_CN"
                                           popup="true"
                                           datePattern="yyyy-MM-dd"
                                           showApplyButton="false"  style="width:200px"/>
                            至
                            <rich:calendar value="#{stit.qlb.numDateEnd}"
                                           locale="zh_CN"
                                           popup="true"
                                           datePattern="yyyy-MM-dd"
                                           showApplyButton="false" style="width:200px"/>
                        </h:panelGroup>
                        <h:selectManyCheckbox value="#{stit.voutypes}">
                            <f:selectItem itemValue="3" itemLabel="借款单"/>
                            <f:selectItem itemValue="0" itemLabel="报销单"/>
                            <f:selectItem itemValue="1" itemLabel="差旅费报销单"/>
                            <f:selectItem itemValue="4" itemLabel="付款申请单"/>
                            <f:selectItem itemValue="5" itemLabel="支出证明单"/>
                            <f:selectItem itemValue="6" itemLabel="出国差旅报销单"/>
                        </h:selectManyCheckbox>


                        <h:commandButton value="查询" action="#{stit.statisticsForPay}"/>
                        <h:commandButton value="取消" action="#{stit.cancel}"/>
                        <h:commandButton value="导出Excel" action="#{stit.exportExcel}"
                                         disabled="#{stit.statModel.rowCount le 0}" />

                    </rich:tab>
                </rich:tabPanel>
                <rich:dataTable id="stitbyperson" value="#{stit.statModel}" var="explist" rows="10"
                                style="width:100%;">
                    <rich:column sortBy="#{explist.number}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="单据编号"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:commandLink action="#{stit.showDetailFromStit}" >
                            <h:outputText value="#{explist.number}"/>
                        </h:commandLink>
                    </rich:column>

                    <rich:column sortBy="#{explist.voutype}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="单据类别"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="借款单"  rendered="#{explist.voutype == '3'}" style="color:red"/>
                        <h:outputText value="报销单"  rendered="#{explist.voutype == '0'}" style="color:blue"/>
                        <h:outputText value="差旅费报销单"  rendered="#{explist.voutype == '1'}" style="color:green"/>
                        <h:outputText value="付款申请单"  rendered="#{explist.voutype == '4'}" />
                        <h:outputText value="支出证明单"  rendered="#{explist.voutype == '5'}" style="color:pink"/>
                        <h:outputText value="出国差旅报销单"  rendered="#{explist.voutype == '6'}" style="color:#Ef6f7e"/>
                        <h:outputText value="合计"  rendered="#{explist.voutype == ''}" />
                    </rich:column>

                    <rich:column sortBy="#{explist.numDate}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="单据日期"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{explist.numDate}">
                            <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{explist.total}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="(借款/报销)金额"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{explist.total}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{explist.taxAmount}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="扣税额"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{explist.taxAmount}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{explist.checkaccount}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="核定金额"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{explist.checkaccount}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{explist.repayment}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="还款金额"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{explist.repayment}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{explist.remain}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="待支付金额"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{explist.remain}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{explist.payaccount}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="支付金额"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{explist.payaccount}">
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:dataScroller id="ds"></rich:dataScroller>
                    </f:facet>
                </rich:dataTable>

            </rich:panel>
        </h:form>
    </h:body>
</html>
